package com.example.review.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

public class MyBroadcastReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        Toast.makeText(context, "收到广播啦", Toast.LENGTH_SHORT).show();
        //todo 这里执行具体的逻辑 切记不要执行耗时的逻辑，不然会报错

        //将这条广播截断,后面 的广播接收器将无法再接收到这条广播
        abortBroadcast();
    }
}